import Vue from 'vue'
//自动注册全局自定义组件
const autoComponent = () => {
    const requireComponent = require.context('./', true, /\.vue$/)
    requireComponent.keys().forEach(fileName => {
        //console.log(fileName)
        const componentConfig = requireComponent(fileName)
        const componentName = fileName.replace(/\.\/(.*?)\.vue/, "$1")
        //console.log(componentName)
        Vue.component(componentName, componentConfig.default)//将使用文件名作为组件名

    })
}
export default {
    autoComponent
}